package com.springapp.utils;


import java.io.File;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

public class XmlParse {
    public Document document = null;

    // 构造函数
    public XmlParse(String path) {
        SAXReader saxReader = new SAXReader();
        try {
            document = saxReader.read(new File(path));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    // 返回元素对象
    public Element getElement() {
        Element element = document.getRootElement();
        return element;
    }
}
